import { BasicColumn } from '/@/components/Table';
//列表数据
export const columns: BasicColumn[] = [
  {
    title: '序号',
    align: 'center',
    dataIndex: 'number',
    width: 50,
  },
  {
    title: '所属部门',
    align: 'center',
    dataIndex: 'orgCode_dictText',
    width: 80,
    // customCell: (record, index, column) => {
    //   if (index === 0) {
    //     return { rowSpan: 2 };
    //   }
    //   if (index === 1){
    //     return { rowSpan: 0 };
    //   }
    // },
  },
  {
    title: '项目名称',
    align: 'center',
    dataIndex: 'projectName',
    width: 180,
  },
  {
    title: '考核指标',
    align: 'center',
    dataIndex: 'assessmenIndicators',
    ellipsis: true,
    width: 180,
  },
  {
    title: '其他指标',
    dataIndex: 'what',
    sorter: false,
    children: [
      {
        title: '核心示范规模',
        dataIndex: 'what',
        sorter: false,
        children: [
          {
            title: '亩',
            align: 'center',
            dataIndex: 'acresFocus',
            width: 80,
          },
          {
            title: '袋',
            align: 'center',
            dataIndex: 'bagFocus',
            width: 80,
          },
          {
            title: '头、只',
            align: 'center',
            dataIndex: 'headFocus',
            width: 80,
          },
          {
            title: '栋',
            align: 'center',
            dataIndex: 'buildingFocus',
            width: 80,
          },
        ],
      },
      {
        title: '示范带动规模',
        dataIndex: 'what',
        sorter: false,
        children: [
          {
            title: '亩',
            align: 'center',
            dataIndex: 'acresPromote',
            width: 80,
          },
          {
            title: '袋',
            align: 'center',
            dataIndex: 'bagPromote',
            width: 80,
          },
          {
            title: '头、只',
            align: 'center',
            dataIndex: 'headPromote',
            width: 80,
          },
          {
            title: '栋',
            align: 'center',
            dataIndex: 'buildingPromote',
            width: 80,
          },
        ],
      },
      {
        title: '推广品种(个)',
        align: 'center',
        dataIndex: 'commercialVariety',
        width: 120,
      },
      {
        title: '示范推广技术(项)',
        align: 'center',
        dataIndex: 'dpTechnology',
        width: 130,
      },
      {
        title: '培训人数(人)',
        align: 'center',
        dataIndex: 'trainNumberPeople',
        width: 100,
      },
      {
        title: '发表论文(篇)',
        align: 'center',
        dataIndex: 'publishPaper',
        width: 100,
      },
      {
        title: '工作宣传报道(篇)',
        align: 'center',
        dataIndex: 'workPromotionReport',
        width: 140,
      },
      {
        title: '专家团队技术服务(次)',
        align: 'center',
        dataIndex: 'expertServices',
        width: 160,
      },
    ],
  },

  {
    title: '资金情况',
    dataIndex: 'what',
    sorter: false,
    children: [
      {
        title: '总资金(万元)',
        align: 'center',
        dataIndex: 'totalPrice',
        width: 100,
      },
      {
        title: '补贴资金(万元)',
        align: 'center',
        dataIndex: 'subsidyAmount',
        width: 120,
      },
      {
        title: '配套资金(万元)',
        align: 'center',
        dataIndex: 'complementAmount',
        width: 120,
      },
    ],
  },

  {
    title: '合作农场',
    align: 'center',
    dataIndex: 'cooperativeFarm',
    ellipsis: true,
    width: 100,
  },
  {
    title: '合作分公司',
    align: 'center',
    dataIndex: 'cooperativeBranch',
    ellipsis: true,
    width: 100,
  },
  {
    title: '示范基地',
    align: 'center',
    dataIndex: 'demonstrationBase',
    ellipsis: true,
    width: 100,
  },
  {
    title: '项目负责人',
    align: 'center',
    dataIndex: 'projectLeader',
    ellipsis: true,
    width: 110,
  },
  {
    title: '联系人',
    align: 'center',
    dataIndex: 'contactBy',
    ellipsis: true,
    width: 80,
  },
  {
    title: '联系人电话',
    align: 'center',
    dataIndex: 'contactNumber',
    ellipsis: true,
    width: 100,
  },
  {
    title: '项目类别',
    align: 'center',
    dataIndex: 'projectType_dictText',
    ellipsis: true,
    width: 150,
  },
];

//子表列表数据
export const conversionSituationTableColumns: BasicColumn[] = [
  {
    title: '成果名称',
    align: 'center',
    dataIndex: 'achievementName',
  },
  {
    title: '来源课题类型',
    align: 'center',
    dataIndex: 'sourceType',
  },
  {
    title: '完成单位',
    align: 'center',
    dataIndex: 'completionOrg',
  },
  {
    title: '主要完成人',
    align: 'center',
    dataIndex: 'completionPersonnel',
  },
  {
    title: '鉴定部门',
    align: 'center',
    dataIndex: 'appraisalOrg',
  },
  {
    title: '鉴定等级',
    align: 'center',
    dataIndex: 'appraisalLevel_dictText',
  },
  {
    title: '是否获得植物新品种保护权',
    align: 'center',
    dataIndex: 'obtainProtection',
  },
  {
    title: '转化时间',
    align: 'center',
    dataIndex: 'transformTime',
  },
  {
    title: '转化方式',
    align: 'center',
    dataIndex: 'transformMethod',
  },
  {
    title: '是否为本年度合同',
    align: 'center',
    dataIndex: 'isAnnualContract_dictText',
  },
  {
    title: '转化合同金额（万元）',
    align: 'center',
    dataIndex: 'conversionContractAmount',
  },
  {
    title: '实际到账金额（万元）',
    align: 'center',
    dataIndex: 'actualAmount',
  },
  {
    title: '转化至单位名称',
    align: 'center',
    dataIndex: 'convertToUnitName',
  },
  {
    title: '推广应用情况',
    align: 'center',
    dataIndex: 'promotionApplicationSituation',
  },
];
//子表列表数据
export const batchAmountTableColumns: BasicColumn[] = [
  {
    title: '计划资金',
    align: 'center',
    dataIndex: 'plannedAmount',
  },
  {
    title: '实际花销资金',
    align: 'center',
    dataIndex: 'actualAmount',
  },
  {
    title: '批次',
    align: 'center',
    dataIndex: 'batch',
  },
  {
    title: '花销日期',
    align: 'center',
    dataIndex: 'expenseTime',
    customRender: ({ text }) => {
      return !text ? '' : text.length > 10 ? text.substr(0, 10) : text;
    },
  },
];

// 高级查询数据
export const superQuerySchema = {
  orgCode: { title: '所属部门', order: 0, view: 'list', type: 'string', dictCode: 'org_code' },
  projectName: { title: '项目名称', order: 1, view: 'text', type: 'string' },
  assessmenIndicators: { title: '考核指标', order: 2, view: 'textarea', type: 'string' },
  acresFocus: { title: '亩-核心示范规模', order: 3, view: 'number', type: 'number' },
  bagFocus: { title: '袋-核心示范规模', order: 4, view: 'number', type: 'number' },
  headFocus: { title: '头、只-核心示范规模', order: 5, view: 'number', type: 'number' },
  buildingFocus: { title: '栋-核心示范规模', order: 6, view: 'number', type: 'number' },
  acresPromote: { title: '亩-示范带动规模', order: 7, view: 'number', type: 'number' },
  bagPromote: { title: '袋-示范带动规模', order: 8, view: 'number', type: 'number' },
  headPromote: { title: '头、只-示范带动规模', order: 9, view: 'number', type: 'number' },
  buildingPromote: { title: '栋-示范带动规模', order: 10, view: 'number', type: 'number' },
  commercialVariety: { title: '推广品种（个）', order: 11, view: 'number', type: 'number' },
  dpTechnology: { title: '示范推广技术（项）', order: 12, view: 'number', type: 'number' },
  trainNumberPeople: { title: '培训人数（人）', order: 13, view: 'number', type: 'number' },
  publishPaper: { title: '发表论文（篇）', order: 14, view: 'number', type: 'number' },
  workPromotionReport: { title: '工作宣传 报道(篇)', order: 15, view: 'number', type: 'number' },
  expertServices: { title: '专家团队技术服务（次）', order: 16, view: 'number', type: 'number' },
  totalPrice: { title: '总资金（万元）', order: 17, view: 'number', type: 'number' },
  subsidyAmount: { title: '补贴资金 （万元）', order: 18, view: 'number', type: 'number' },
  complementAmount: { title: '配套资金 （万元）', order: 19, view: 'number', type: 'number' },
  cooperativeFarm: { title: '合作农场', order: 20, view: 'text', type: 'string' },
  cooperativeBranch: { title: '合作分公司', order: 21, view: 'text', type: 'string' },
  demonstrationBase: { title: '示范基地', order: 22, view: 'text', type: 'string' },
  projectLeader: { title: '项目负责人', order: 23, view: 'text', type: 'string' },
  contactBy: { title: '联系人', order: 24, view: 'text', type: 'string' },
  contactNumber: { title: '联系人电话', order: 25, view: 'text', type: 'string' },
  projectType: { title: '项目类别', order: 26, view: 'text', type: 'string', dictCode: 'project_type_code' },
};
